#include <butil/logging.h>
#include <brpc/channel.h>
#include "cal.pb.h" 

int main(int argc, char* argv[])
{
    brpc::ChannelOptions options;
    options.protocol = "baidu_std";

    brpc::Channel channel;

    channel.Init("192.168.56.129:9000", &options);

    cal::CalService_Stub stub(&channel);
    brpc::Controller controller;
    cal::AddReq request;
    cal::AddRsp response;
    request.set_num1(10);
    request.set_num2(20);
    stub.Add(&controller, &request, &response, NULL);
    if(controller.Failed() == true)
    {
        std::cout << "Add failed: " << controller.ErrorText() << std::endl;
        return -1;
    }
    std::cout << response.result() << std::endl;
    return 0;
}